package com.tupu.mapper.dispatch;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tupu.entity.dispatch.*;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface DadsDdrzMapper {

    Page<HistoryList> getHistoryJxd(Page page, @Param("sbmc") String sbmc, @Param("czmc") String czmc);

    Page<HistoryList> getHistoryBgd(Page page, @Param("sbmc") String sbmc, @Param("czmc") String czmc);

    @Select("SELECT count(1)  FROM `operationticket` a where date_format(a.NPR_TIME,'%Y-%m-%d') = #{date}")
    Integer getCzpsl(@Param("date") String date);

    @Select("select count(1) from mwt_ud_zhtdnjh b where b.pztdkssj >= #{kssj} and b.pzfdjssj <= #{jssj}")
    Integer getJxjhsl(@Param("kssj") String kssj, @Param("jssj") String jssj);

    @Select("select count(id) from t_runlog_log_sbqx_dd c where DATE_FORMAT(c.WRITE_TIME,'%Y-%m-%d') = #{date} and c.DEFECT_LEVEL like concat('%',#{qxlx},'%') ")
    Integer getqxsl(@Param("date") String date, @Param("qxlx") String qxlx);

    @Select("select count(1) from dads_jwfx b where b.pztdkssj >= #{kssj} and b.pzfdjssj <= #{jssj} and b.sjdj = #{sjdj} ")
    Integer getDwfxdjsl(@Param("kssj") String kssj, @Param("jssj") String jssj, @Param("sjdj") String sjdj);

    List<DispatchOperTickets> getDadsCzpResult(@Param("date") String date, @Param("productName") String productName, @Param("station") String station);

    List<DispatchDefectHandles> getDadsSbqxResult(@Param("date") String date, @Param("productName") String productName, @Param("station") String station);

    Page<DispatchPlannedOverhaulPlan> getDispatchPlannedOverhaulPlan(Page page, @Param("stationName") String stationName, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("workContent") String workContent, @Param("intervalName") String intervalName);

    List<String> getStationName();

    List<String> getIntervalName(String stationName);

    Page<DispatchPlannedOperTicket> getDadsCzp(Page page, @Param("stationName") String stationName, @Param("startDate") String startDate, @Param("endDate") String endDate);

    String queryCzmcBySbmcLn(@Param("sbmc") String sbmc);

    String queryCzmcBySbmc(@Param("sbmc") String sbmc);

    Page<VDadsDdrz> getVDadsDdrzByPage(Page page, @Param("station") String station, @Param("ycqk") String ycqk, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("sbmc") String sbmc);

    //定时任务查询处理计划操作票
    List<DispatchPlannedOverhaulPlan> getDispatchCZP();
}
